<template>
  <div>
    <el-menu :default-active="activeIndex2" class="el-menu-demo top-nav-bar" mode="horizontal" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
      <el-menu-item index="1">美多商城后台</el-menu-item>
      <el-submenu index="2">
        <template slot="title">商品管理</template>
        <el-menu-item index="2-1" @click="$router.push({name: 'selectgoods'})">查看商品</el-menu-item>
        <el-menu-item index="2-2" @click="$router.push({name: 'addgoods'})">新增商品</el-menu-item>
      </el-submenu>
      <el-menu-item index="4">订单管理</el-menu-item>
      <el-menu-item index="3">用户管理</el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'AdminContainer',
  data() {
    return {
      activeIndex: '1',
      activeIndex2: '1'
    }
  },
  methods: {

  }
}
</script>

<style lang="less" scoped>
.top-nav-bar {
  position: sticky;/*兼容*/
  top: 0;
  left: 0;
  z-index: 99;
}
</style>